import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';

@Component({
    selector: 'itmp-photo-equipment',
    templateUrl: './photo-equipment.component.html',
    styleUrls: ['./photo-equipment.component.css']
})
export class PhotoEquipmentComponent implements OnInit {
    @Input() visible = false;
    @Output() visibleChange = new EventEmitter<boolean>();
    @Input() photoGroup = [];
    containerWidth = 0;
    constructor() {}

    ngOnInit() {
        if (this.photoGroup && this.photoGroup.length > 0) {
            this.containerWidth = this.photoGroup.length * 410;
        } else {
            this.containerWidth = 800;
        }
    }
    handleCancel() {
        this.visible = false;
        this.visibleChange.emit(this.visible);
    }
}
